package adminController

import (
	"gin/chibuda/app/admin/adminService"
	"gin/chibuda/app/utils"
	"github.com/gin-gonic/gin"
)

//获取vue端路由
func GetMenu(c *gin.Context){
	r := adminService.GetMenu()
	c.JSON( r.HttpCode, r.Rs)
}

func MenuEdit(c *gin.Context){
	data := utils.Input(c)
	r := adminService.MenuEdit(data)
	c.JSON( r.HttpCode, r.Rs)
}

func MenuDel(c *gin.Context){
	data := utils.Input(c)
	r := adminService.MenuDel(data)
	c.JSON( r.HttpCode, r.Rs)
}

//获取vue端路由
func AdminUserList(c *gin.Context){
	data:=utils.Input(c)
	r := adminService.AdminUserList(data)
	c.JSON( r.HttpCode, r.Rs)
}

func AdminUserEdit(c *gin.Context){
	data:=utils.Input(c)
	r := adminService.AdminUserEdit(data)
	c.JSON( r.HttpCode, r.Rs)
}

//获取所有路由
func AdminUserGetRole(c *gin.Context){
	r := adminService.AdminUserGetRole()
	c.JSON( r.HttpCode, r.Rs)
}

func AdminUserDel(c *gin.Context){
	data:=utils.Input(c)
	r := adminService.AdminUserDel(data["id"])
	c.JSON( r.HttpCode, r.Rs)
}

func RoleList(c *gin.Context){
	data:=utils.Input(c)
	r := adminService.RoleList(data)
	c.JSON( r.HttpCode, r.Rs)
}

func RoleEdit(c *gin.Context){
	data := utils.Input(c)
	r := adminService.RoleEdit(data)
	c.JSON( r.HttpCode, r.Rs)
}

func RoleDel(c *gin.Context){
	data:=utils.Input(c)
	r := adminService.RoleDel(data["id"])
	c.JSON( r.HttpCode, r.Rs)
}

func RoleMenu(c *gin.Context)  {
	data:=utils.Input(c)
	r := adminService.RoleMenu(data["id"])
	c.JSON( r.HttpCode, r.Rs)
}

func RoleMenuAuth(c *gin.Context){
	data:=utils.Input(c)
	r := adminService.RoleMenuAuth(data)
	c.JSON( r.HttpCode, r.Rs)
}

